def format(number,width):
    str_num = ''
    l = 1
    while number>10:
        n,number = number%10,number//10
        str_num = str(n) + str_num
        l += 1
    str_num =  str(number) + str_num

    for i in range(l,width):
        str_num = "0"+str_num

    return str_num

number = eval(input("请输入一个数"))
width = eval(input("请输入长度"))
print(format(number,width))